package com.ndp.fb.enums.feed;

import java.util.ArrayList;
import java.util.List;

/**
 * The condition of the product. Accepted values are new, refurbished, or used
 * Created by hunk.qin on 2016/4/20.
 */
public enum Condition {

    newkey("new"),refurbished("refurbished"),used("used");

    private  String value;
    Condition(String value){
        this.value=value;
    }

    public static List<String> getValues(){
        ArrayList<String> list=new ArrayList<>();
        for (Condition condition : Condition.values()) {
            list.add(condition.value);
        }
        return list;
    }

    public static boolean contain(String value){
        for (Condition condition : Condition.values()) {
            if (condition.value.equals(value)) {
                return true;
            }
        }
        return false;
    }
}
